package com.ss.android.action.a.c;

import android.app.Activity;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.bytedance.common.utility.Logger;
import com.bytedance.common.utility.UIUtils;
import com.ss.android.article.browser.R;

public abstract class ThemedCommentDialog extends ShareDialog {
    public View A;
    private TextView B;
    private TextView C;
    private TextView D;
    private TextView E;
    private boolean mNightMode = false;
    public View z;

    public ThemedCommentDialog(Activity activity) {
        super(activity);
    }

    protected final boolean c() {
        return false;
    }

    protected final void tryRefreshTheme() {
        super.tryRefreshTheme();
        this.mNightMode = com.ss.android.j.b.isNightModeToggled();
        Logger.i("ThemedCommentDialog", "tryRefreshTheme");
        Logger.i("ThemedCommentDialog mNightMode", String.valueOf(this.mNightMode));
        this.g();
    }

    public void g() {
        int v0;
        ColorStateList v1_1;
        int v1 = R.color.btn_common_text;
        int v5 = R.drawable.m2;
        int v4 = R.drawable.c6;
        Resources v2 = this.getContext().getResources();
        if (this.mNightMode) {
            v1_1 = v2.getColorStateList(R.color.btn_common_text);
            v0 = R.color.title_text_color_night;
        } else {
            v1_1 = v2.getColorStateList(R.color.btn_common_text);
            v0 = R.color.title_text_color;
        }

        if (this.B != null) {
            UIUtils.setMaxLines(this.B, v4);
            this.B.setTextColor(v1_1);
        }

        if (this.C != null) {
            UIUtils.setMaxLines(this.C, v4);
            this.C.setTextColor(v1_1);
        }

        if (this.mTitle != null) {
            this.mTitle.setTextColor(v2.getColor(v0));
        }

        if (this.mTitleBar != null) {
            this.mTitleBar.setBackgroundResource(com.ss.android.article.browser.R.drawable.bx);
        }

        if (this.mNightMode) {
            v0 = v2.getColor(com.ss.android.article.browser.R.color.gf);
            this.z.setBackgroundColor(v2.getColor(com.ss.android.article.browser.R.color.gd));
            UIUtils.setBackgroundResource(this.A, v5);
            this.mShareText.setTextColor(v2.getColor(com.ss.android.article.browser.R.color.gl));
            this.mShareText.setHintTextColor(v2.getColor(com.ss.android.article.browser.R.color.gk));
            if (this.E != null) {
                this.E.setTextColor(v2.getColor(com.ss.android.article.browser.R.color.gh));
            }
        } else {
            v0 = v2.getColor(com.ss.android.article.browser.R.color.ge);
            this.z.setBackgroundColor(v2.getColor(com.ss.android.article.browser.R.color.gc));
            UIUtils.setBackgroundResource(this.A, v5);
            this.mShareText.setTextColor(v2.getColor(com.ss.android.article.browser.R.color.gi));
            this.mShareText.setHintTextColor(v2.getColor(com.ss.android.article.browser.R.color.gj));
            if (this.E != null) {
                this.E.setTextColor(v2.getColor(com.ss.android.article.browser.R.color.gg));
            }
        }

        if (this.D != null) {
            this.D.setTextColor(v0);
        }

        this.mLimitText.setTextColor(v0);
    }

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        if ((this.mBack instanceof TextView)) {
            this.B = (TextView) this.mBack;
        }

        if ((this.mShareBtn instanceof TextView)) {
            this.C = (TextView) this.mShareBtn;
        }

        this.z = this.findViewById(com.ss.android.article.browser.R.id.root_view);
        this.A = this.findViewById(com.ss.android.article.browser.R.id.le);
        this.D = this.findViewById(com.ss.android.article.browser.R.id.ab0);
        this.E = this.findViewById(com.ss.android.article.browser.R.id.ab1);
    }
}

